package com.wss.common.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class Result implements Serializable {

    private  String msg;

    private  int code;

    private   Object date;


    public  Result (String msg,int code){
//        return new Result(msg,code,null);
        this.msg=msg;
        this.code=code;
        this.date=null;
    }

    public static Result success(String msg){
        return  new Result(msg,200);
    }
    public static Result success(String data,String msg){
        return  new Result(msg,200,data);
    }
    public static  Result success(){
        return  new Result("",200);
    }

    public  static Result fail(String msg){
        return  new Result(msg,500);
    }
    public  static Result fail(int code,String msg){
        return  new Result(msg,500);
    }
}
